#ifndef COLLISIONMANAGER_H
#define COLLISIONMANAGER_H

#include "Collision.h"
#include "CollisionHelper.h"
#include <map>
#include <list>

namespace model
{

class CollisionManager
{
public:
	CollisionManager();
	~CollisionManager();

	void addPasiveEntity(Entity *entidad);
	void addActiveEntity(Entity *entidad);

	void removeEntity   (Entity *entidad);

	void calculateCollisions();

	std::list<Collision>& getCollisions();

protected:

	void calculateCollisionsBetween(std::map<int, Entity*> &collection1, std::map<int, Entity*> &collection2);

	auto_ptr<CollisionHelper>           _collisionHelper;

	std::list<Collision>                _collisions;
	std::map<int, Entity*>              _activeEntities, _passiveEntities;
	std::map<std::pair<int, int>, bool> _trackCollisions;
};
};
#endif

